class Entity(object):
    def __init__(self):
        # name
        self.name = ''
        # entity can move / be pushed
        self.movable = False
        # color
        self.color = None
        # max speed
        self.max_speed = None
        # current speed
        self.cur_speed = None
        # 当前转向速度
        self.turning_speed = None
        # 加速度
        self.cur_accel = None
        # 转向加速度
        self.turning_accel = None
        # state
        # self.state = EntityState()
        # mass
        # self.initial_mass = 1.0
        # shape
        # self.shape = CircleEntity(self.size)
        # 几何模型
        self._show_model = None
        self._collision_model = None

        self.start_angle = 0  # 单位：角度°

    def collision_with_other(self, other):
        if self == other:
            return False
        if not other or not isinstance(other, Entity):
            return False
        if self.get_collision_model() and other.get_collision_model():
            return self.get_collision_model().collision_with_other(other.get_collision_model())
        return False

    def dif_with_start_angle(self):
        if not self._collision_model:
            return 0
        return self._collision_model.angle - self.start_angle

    def dif_with_start_angle_abs(self):
        return abs(self.dif_with_start_angle())

    def get_show_model(self):
        return self._show_model

    def set_show_model(self, model):
        self._show_model = model

    def get_collision_model(self):
        return self._collision_model

    def set_collision_model(self, model):
        self._collision_model = model
